package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Yonghuxinxishenhe;
import com.ruoyi.system.service.IYonghuxinxishenheService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 用户信息审核Controller
 * 
 * @author ruoyi
 * @date 2024-08-13
 */
@RestController
@RequestMapping("/system/yonghuxinxishenhe")
public class YonghuxinxishenheController extends BaseController
{
    @Autowired
    private IYonghuxinxishenheService yonghuxinxishenheService;

    /**
     * 查询用户信息审核列表
     */
    @PreAuthorize("@ss.hasPermi('system:yonghuxinxishenhe:list')")
    @GetMapping("/list")
    public TableDataInfo list(Yonghuxinxishenhe yonghuxinxishenhe)
    {
        startPage();
        List<Yonghuxinxishenhe> list = yonghuxinxishenheService.selectYonghuxinxishenheList(yonghuxinxishenhe);
        return getDataTable(list);
    }

    /**
     * 导出用户信息审核列表
     */
    @PreAuthorize("@ss.hasPermi('system:yonghuxinxishenhe:export')")
    @Log(title = "用户信息审核", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Yonghuxinxishenhe yonghuxinxishenhe)
    {
        List<Yonghuxinxishenhe> list = yonghuxinxishenheService.selectYonghuxinxishenheList(yonghuxinxishenhe);
        ExcelUtil<Yonghuxinxishenhe> util = new ExcelUtil<Yonghuxinxishenhe>(Yonghuxinxishenhe.class);
        util.exportExcel(response, list, "用户信息审核数据");
    }

    /**
     * 获取用户信息审核详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:yonghuxinxishenhe:query')")
    @GetMapping(value = "/{yhshLsid}")
    public AjaxResult getInfo(@PathVariable("yhshLsid") Long yhshLsid)
    {
        return success(yonghuxinxishenheService.selectYonghuxinxishenheByYhshLsid(yhshLsid));
    }

    /**
     * 新增用户信息审核
     */
    @PreAuthorize("@ss.hasPermi('system:yonghuxinxishenhe:add')")
    @Log(title = "用户信息审核", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody Yonghuxinxishenhe yonghuxinxishenhe)
    {
        return toAjax(yonghuxinxishenheService.insertYonghuxinxishenhe(yonghuxinxishenhe));
    }

    /**
     * 修改用户信息审核
     */
    @PreAuthorize("@ss.hasPermi('system:yonghuxinxishenhe:edit')")
    @Log(title = "用户信息审核", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Yonghuxinxishenhe yonghuxinxishenhe)
    {
        return toAjax(yonghuxinxishenheService.updateYonghuxinxishenhe(yonghuxinxishenhe));
    }

    /**
     * 删除用户信息审核
     */
    @PreAuthorize("@ss.hasPermi('system:yonghuxinxishenhe:remove')")
    @Log(title = "用户信息审核", businessType = BusinessType.DELETE)
	@DeleteMapping("/{yhshLsids}")
    public AjaxResult remove(@PathVariable Long[] yhshLsids)
    {
        return toAjax(yonghuxinxishenheService.deleteYonghuxinxishenheByYhshLsids(yhshLsids));
    }
}
